<template>
  <el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
    <vab-chart
      :init-options="initOptions"
      :option="option"
      theme="vab-echarts-theme"
      style="width: 100%; height: 300px"
    />
  </el-col>
</template>

<script>
  import VabChart from '@/extra/VabChart'

  export default {
    name: 'VabChartBar',
    components: {
      VabChart,
    },
    data() {
      return {
        initOptions: {
          renderer: 'svg',
        },
        option: {
          legend: {
            right: 0,
            top: 0,
            containLabel: false,
            data: ['消费发起数', '消费成功数'],
          },

          tooltip: {
            trigger: 'axis',
            axisPointer: {
              type: 'shadow',
            },
          },
          grid: {
            top: 40,
            right: 0,
            bottom: 40,
            left: 50,
          },
          xAxis: {
            type: 'category',
            data: ['5-11', '5-12', '5-13'],
          },
          yAxis: {
            type: 'value',
            splitLine: {
              lineStyle: {
                type: 'dashed',
              },
            },
          },
          series: [
            {
              data: [98, 109, 79],
              type: 'bar',
              name: '消费发起数',
              type: 'bar',
              barWidth: 12,
              barGap: 0,
              color: '#6197ff',
            },
            {
              data: [40, 70, 65],
              type: 'bar',
              name: '消费成功数',
              type: 'bar',
              barWidth: 12,
              barGap: 0,
              color: '#a7c987',
            },
          ],
        },
      }
    },
  }
</script>
